/*
 * vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4 foldmethod=marker:
 *
 * rotatedlogs.h
 *
 * C.C.Allison
 * chris.allison@hotmail.com
 *
 * Started: Friday 15 February 2013, 07:21:12
 * Version: 0.00
 * Revision: $Id: rotatedlogs.h 53 2013-02-18 22:43:38Z chris.charles.allison@gmail.com $
 * Last Modified: Sunday 17 February 2013, 12:03:14
 */

#include "defs.h"
#include "macros.h"
#include "tools.h"
#include "configfile.h"
#include "regex.h"
#include "structs.h"
#include "globals.h"

extern struct LogFile *rotatedlogs;
extern time_t is_logline(char *line, char *format);
extern int readThroughFFile( struct FollowedFile *ffile, FILE *ffp );
extern void resetFollowFile(struct FollowedFile *ffile);

void freeRotatedLogFileNames(char **rlfnames);
char **getRotatedLogFileNames(char *fqlogfilename);
void parseRotatedLogs(struct FollowedFile *ff,char **rlfnames);
void indexRotatedLogs(char **rlfnames);
struct LogFile *addRotatedLogFile( char *filename, int filenum );
int logfileFilter(const struct dirent *entry);
FILE *openLogFile(struct LogFile *rlf);
int indexLogFile(struct LogFile *rlf);
FILE *openGzipFile(char *filename);
FILE *openZipFile(char *filename);
int indexOpenLogFile( FILE *ofp, struct LogFile *rlogfile );
int filetype( char *filename );
void parseRotatedLog(struct FollowedFile *ffile,int filenum);
int finishReadingRotatedFile( struct FollowedFile *ffile, int filenum );
void deleteOldestRotatedLogfile(void);
void incrementRotatedLogfiles(void);
void freeRotatedLogFiles( void );
void printRotatedLogs(void);
void printRLog(struct LogFile *rlf);
